package com.liuym.student.service;

import com.liuym.common.exception.StudentException;
import com.liuym.student.repository.model.bo.StudentScoreBO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Liuym
 * @date 2018/12/10 10:19
 * @describe：
 */
public interface StudentScoreService {
    /**
     * 添加分数
     *
     * @param userName
     * @param studentScoreBO
     * @return
     * @throws StudentException
     */
    boolean addStudentScore(String studentScoreTableName, String userName, StudentScoreBO studentScoreBO)
            throws StudentException;

    /**
     * 添加分数
     *
     * @param userName
     * @param studentScoreBOList
     * @return
     * @throws StudentException
     */
    Map<String, Object> addStudentScoreBatch(
            String studentScoreTableName, String userName, List<StudentScoreBO> studentScoreBOList)
            throws StudentException;

    /**
     * 根据学号获得分数信息
     *
     * @param studentNumber
     * @return
     */
    List<StudentScoreBO> getStudentScoreByStudentNumber(
            String studentScoreTableName, long studentNumber) throws StudentException;

    /**
     * 根据id获得分数信息
     *
     * @param id
     * @return
     */
    StudentScoreBO getStudentScoreById(String studentScoreTableName, int id) throws StudentException;

    /**
     * 更新分数信息
     *
     * @param studentScoreBO
     * @return
     */
    int updateStudentScore(String studentScoreTableName, StudentScoreBO studentScoreBO)
            throws StudentException;

    /**
     * 删除分数
     *
     * @param id
     * @return
     */
    int deleteStudentScore(String studentScoreTableName, int id) throws StudentException;

    /**
     * 删除分数
     *
     * @param studentNumber
     * @return
     */
    int deleteStudentScoreByNumber(String studentScoreTableName, long studentNumber) throws StudentException;


    /**
     * 获得一定时间内的分数信息
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<StudentScoreBO> getStudentScoreByTime(
            String studentScoreTableName, Date startTime, Date endTime) throws StudentException;

    /**
     * 获得某个管理员操作的分数信息
     *
     * @param userName
     * @param startTime
     * @param endTime
     * @return
     */
    List<StudentScoreBO> getStudentScoreByAdmin(
            String studentScoreTableName, String userName, Date startTime, Date endTime)
            throws StudentException;

    /**
     * 新建学生分数表
     *
     * @return
     */
    int addStudentScoreTable(String studentScoreTableName) throws StudentException;

    /**
     * 查询历史分数
     * @param studentScoreTable
     * @param studentNumber
     * @return
     */
    List<StudentScoreBO> findHistory(String studentScoreTable, long studentNumber);

    List<String> getStudentScoreTableAll() throws StudentException;
}

